package com.tencreat.domain.account;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tencreat.common.annotation.Excel;
import com.tencreat.common.core.domain.BaseEntity;
import com.tencreat.common.enums.UserType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;


/**
 * 用户对象 mall_user
 *
 * @author tencreat
 * @date 2021-11-10
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@ApiModel
@TableName("mall_user")
public class MallUser extends BaseEntity<MallUser> {
    private static final long serialVersionUID = 1L;


    /**
     * $column.columnComment
     */
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "ID")
    private Long id;


    /**
     * uuid
     */
    @Excel(name = "uuid")
    @ApiModelProperty(value = "uuid")
    @TableField("`uuid`")
    private Long uuid;


    /**
     * 用户名称
     */
    @Excel(name = "用户名称")
    @ApiModelProperty(value = "用户名称")
    @TableField("`username`")
    private String username;


    /**
     * 用户密码
     */
    @Excel(name = "用户密码")
    @ApiModelProperty(value = "用户密码")
    @TableField("`password`")
    private String password;


    /**
     * 支付密码
     */
    @Excel(name = "支付密码")
    @ApiModelProperty(value = "支付密码")
    @TableField("`pay_password`")
    private String payPassword;


    /**
     * 性别：0 未知， 1男， 1 女
     */
    @Excel(name = "性别：0 未知， 1男， 1 女")
    @ApiModelProperty(value = "性别：0 未知， 1男， 1 女")
    @TableField("`gender`")
    private Integer gender;


    /**
     * 生日
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("`birthday`")
    @ApiModelProperty(value = "生日")
    private LocalDateTime birthday;


    /**
     * 最近一次登录时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最近一次登录时间", width = 30, dateFormat = "yyyy-MM-dd")
    @TableField("`last_login_time`")
    @ApiModelProperty(value = "最近一次登录时间")
    private LocalDateTime lastLoginTime;


    /**
     * 最近一次登录IP地址
     */
    @Excel(name = "最近一次登录IP地址")
    @ApiModelProperty(value = "最近一次登录IP地址")
    @TableField("`last_login_ip`")
    private String lastLoginIp;


/**
     * 会员等级/用户等级

    @Excel(name = "用户等级")
    @ApiModelProperty(value = "用户等级")
    @TableField("`user_level`")
    private UserType userLevel;*/



    /**
     * 用户昵称或网络名称
     */
    @Excel(name = "用户昵称或网络名称")
    @ApiModelProperty(value = "用户昵称或网络名称")
    @TableField("`nickname`")
    private String nickname;


    /**
     * 用户手机号码
     */
    @Excel(name = "用户手机号码")
    @ApiModelProperty(value = "用户手机号码")
    @TableField("`mobile`")
    private String mobile;


    /**
     * 用户头像图片
     */
    @Excel(name = "用户头像图片")
    @ApiModelProperty(value = "用户头像图片")
    @TableField("`avatar`")
    private String avatar;


    /**
     * 微信登录openid
     */
    @Excel(name = "微信登录openid")
    @ApiModelProperty(value = "微信登录openid")
    @TableField("`weixin_openid`")
    private String weixinOpenid;


    /**
     * 推荐人uuid
     */
    @Excel(name = "邀请人uuid")
    @ApiModelProperty(value = "邀请人uuid")
    @TableField("`referrer_uuid`")
    private Long referrerUuid;


    /**
     * 微信登录会话KEY
     */
    @Excel(name = "微信登录会话KEY")
    @ApiModelProperty(value = "微信登录会话KEY")
    @TableField("`session_key`")
    private String sessionKey;


    /**
     * 0 可用, 1 禁用, 2 注销
     */
    @Excel(name = "状态：0 可用, 1 禁用, 2 注销")
    @ApiModelProperty(value = "0 可用, 1 禁用, 2 注销")
    @TableField("`status`")
    private Integer status;

    @ApiModelProperty("微信开放平台唯一ID")
    @TableField("`union_id`")
    private String unionId;


    /**
     * 余额
     */
    @Excel(name = "余额")
    @ApiModelProperty(value = "余额")
    @TableField("`balance`")
    private BigDecimal balance;

    /**
     * 待结算余额
     */
    @Excel(name = "待结算余额")
    @ApiModelProperty(value = "待结算余额")
    @TableField("`waiting_balance`")
    private BigDecimal waitingBalance;

 /*
    *//**
     * 购物积分
     *//*
    @Excel(name = "购物积分")
    @ApiModelProperty(value = "购物积分")
    @TableField("`buy_integral`")
    private BigDecimal buyIntegral;


   /**
     * 现金积分
     *//*
    @Excel(name = "现金积分")
    @ApiModelProperty(value = "现金积分")
    @TableField("`cash_integral`")
    private BigDecimal cashIntegral;
*/

    /**
     *提货单 //拼团卷
     */
    @Excel(name = "提货单")
    @ApiModelProperty(value = "提货单")
    @TableField("`goods_roll`")
    private BigDecimal goodsRoll;


    /**
     * 消费券//现金券
     */
    @Excel(name = "消费券")
    @ApiModelProperty(value = "消费券")
    @TableField("`consumer_roll`")
    private BigDecimal consumerRoll;


    /**
     * 用户类型
     */
    @Excel(name = "用户类型")
    @ApiModelProperty(value = "用户类型")
    @TableField("`head_type`")
    private UserType headType;


    /**
     * 删除标志（0代表存在 2代表删除）
     */
    @TableLogic
    @TableField("`del_flag`")
    private String delFlag;


/*
    */
/**
     * 租户ID
     */

    @Excel(name = "租户ID")
    @ApiModelProperty(value = "租户ID")
    @TableField("`tenant_id`")
    private Long tenantId;


    /**
     * 邀请人手机号码
     */
    @Excel(name = "邀请人手机号码")
    @ApiModelProperty(value = "邀请人手机号码")
    @TableField("`up_mobile`")
    private String upMobile;

    /**
     * 用户累计收益
     */
    @Excel(name = "用户累计收益")
    @ApiModelProperty(value = "用户累计收益")
    @TableField("`user_income`")
    private BigDecimal userIncome;

    /**
     * 用户累今日收益
     */
    @Excel(name = "用户今日收益")
    @ApiModelProperty(value = "用户累今日收益")
    @TableField("`user_income_today`")
    private BigDecimal userIncomeToday;

    /**
     * 用户阶级关系
     */
    @Excel(name = "用户阶级关系")
    @ApiModelProperty(value = "用户阶级关系")
    @TableField("`class_relations`")
    private String classRelations;

    @ApiModelProperty("层级")
    private Integer tier;

/*
    /**
     * 用户svip到期时间
     *//*
    @ApiModelProperty("用户svip到期时间")
    @Excel(name = "用户svip到期时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    @TableField("svip_end_time")
    private LocalDateTime sVipEndTime;

*//**
     * 用户svip到期时间
     *//*

    @ApiModelProperty("开通Vip时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("start_svip_time")
    private LocalDateTime startsVipTime;


*//**
     * 是否自动拼团
     *//*

    @ApiModelProperty("是否自动拼团")
    @Excel(name = "是否自动拼团")
    @TableField("auto_pt")
    private Integer autoPt;



    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    @ApiModelProperty(value = "VIP开始时间")
    private LocalDateTime vipStartTime;
    */

    @ApiModelProperty("注册时间开始")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private LocalDateTime startTime;

    @ApiModelProperty("注册时间结束")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private LocalDateTime endTime;


    /**
     * 是否为供应商
     */
    @Excel(name = "是否为供应商 是否为供应商0 否  1 是  2 申请中 3 拒绝")
    @ApiModelProperty(value = "是否为供应商 是否为供应商0 否  1 是  2 申请中 3 拒绝")
    @TableField("`supplier`")
    private Long supplier;


    /**
     * 是否为店铺
     */
    @Excel(name = "是否为店铺 是否为店铺0 否  1 是  2 申请中 3 拒绝")
    @ApiModelProperty(value = "是否为店铺 是否为店铺0 否  1 是  2 申请中 3 拒绝")
    @TableField("`store`")
    private Long store;


    @ApiModelProperty(value = "是否存在下级")
    @TableField(exist = false)
    private Boolean hasKids;
/*    *//****
     * 年限
     *//*
    @ApiModelProperty(value = "会员类型")
    @TableField(exist = false)
    private Integer memberType;*/

    @ApiModelProperty("供应商名称")
    @TableField(exist = false)
    private String supplierName;

    @ApiModelProperty("店铺名称")
    @TableField(exist = false)
    private String storeName;

    @ApiModelProperty("货款")
    @TableField(exist = false)
    private BigDecimal goodsPayment;

    @Excel(name = "真实姓名",sort = 7)
    @TableField("`real_name`")
    @ApiModelProperty(value = "真实姓名")
    private String realName;

    @ApiModelProperty("身份证")
    @TableField("`id_card`")
    private String idCard;

    @ApiModelProperty("累计收益")
    private BigDecimal accruedIncome;

    @ApiModelProperty("待结算收益")
    private BigDecimal  waitIncome;

    @ApiModelProperty("排序字段")
    @TableField(exist = false)
    private String sortStr;

    @ApiModelProperty("排序规则")
    @TableField(exist = false)
    private String sortDesc;

    @ApiModelProperty("后台用户ID")
    @TableField("user_id")
    private Long userId;

    @ApiModelProperty("用户类型")
    @TableField(exist = false)
    private String isVipDesc;

    @ApiModelProperty(value = "0 可用, 1 禁用, 2 注销")
    @TableField(exist = false)
    private String statusDesc;

    /**
     * 根据type来导出不同的对象值
     */
    @ApiModelProperty("导出类型")
    @TableField(exist = false)
    private Integer type;

    @Excel(name = "供应商待结算货款")
    @ApiModelProperty(value = "供应商待结算货款")
    @TableField("`finance_wait`")
    private BigDecimal financeWait;

    @Excel(name = "供应商货款")
    @ApiModelProperty(value = "供应商货款")
    @TableField("`finance`")
    private BigDecimal finance;

    @Excel(name = "店铺待结算货款")
    @ApiModelProperty(value = "店铺待结算货款")
    @TableField("`store_finance_wait`")
    private BigDecimal storeFinanceWait;

    @Excel(name = "店铺货款")
    @ApiModelProperty(value = "店铺货款")
    @TableField("`store_finance`")
    private BigDecimal storeFinance;

    @ApiModelProperty("直推人数")
    @TableField(exist = false)
    private Integer pushCount;

    @ApiModelProperty("团队人数")
    @TableField(exist = false)
    private Integer teamCount;

    @TableField(exist = false)
    private List<MallUser> children;


    @ApiModelProperty(value = "累计充值")
    private  BigDecimal recharge;

    @ApiModelProperty(value = "累计消费")
    private  BigDecimal consumer;

    @Excel(name = "结算中提货单")
    @ApiModelProperty(value = "结算中提货单")
    @TableField("`goods_roll_wait`")
    private BigDecimal goodsRollWait;

    @Excel(name = "实名状态 0 未实名 1 已实名")
    @ApiModelProperty(value = "实名状态 0 未实名 1 已实名")
    @TableField("`real_status`")
    private Integer realStatus;


    @Excel(name = "代采购额度")
    @ApiModelProperty(value = "代采购额度")
    @TableField("`recharge_limit`")
    private BigDecimal rechargeLimit;
}
